package wli.web.util;

import java.util.*;
import java.io.*;

public class MySqlTable {
    public StringBuffer getForum(String table_name, int db_type) {
	StringBuffer sbf = new StringBuffer();

	if(db_type==1) {
	    sbf.append("CREATE CACHED TABLE "+ table_name+" ");
	}

	sbf.append("(FIELD1 INTEGER IDENTITY PRIMARY KEY,"); //auto id
	sbf.append(" FIELD2 INTEGER,");                      //gid
	sbf.append(" FIELD3 VARCHAR(20),");                  //pid
	sbf.append(" FIELD4 VARCHAR(20),");                  //reply
	sbf.append(" FIELD5 VARCHAR_IGNORECASE(250),");      //title
	sbf.append(" FIELD6 TIMESTAMP,");                    //timestamp
	sbf.append(" FIELD7 VARCHAR_IGNORECASE(20),");       //username
	sbf.append(" FIELD8 VARCHAR(50),");                  //size
	sbf.append(" FIELD9 VARCHAR(10),");                  //readers
	sbf.append(" FIELD10 VARCHAR(20),");                 //password
	sbf.append(" FIELD11 VARCHAR_IGNORECASE(120000),");  //text
	sbf.append(" FIELD12 VARCHAR(20),");                 //image
	sbf.append(" FIELD13 VARCHAR(20),");                 //link
	sbf.append(" FIELD14 VARCHAR(20),");                 //
	sbf.append(" FIELD15 VARCHAR(20),");                 //
	sbf.append(" FIELD16 VARCHAR(20),");                 //
	sbf.append(" FIELD17 VARCHAR(20),");                 //
	sbf.append(" FIELD18 VARCHAR(20),");                 //
	sbf.append(" FIELD19 VARCHAR(20),");                 //
	sbf.append(" FIELD20 VARCHAR(20));");                //user_ip
	return sbf;
    }

    public static StringBuffer getShoppingHotDealsTable(String table_name, int db_type) {
	StringBuffer sbf = new StringBuffer();

	if(db_type==1) {
	    sbf.append("CREATE CACHED TABLE "+ table_name+" ");
	}

	sbf.append("(ID INTEGER IDENTITY PRIMARY KEY,");
	sbf.append("TIME_STAMP TIMESTAMP,");
	sbf.append("TITLE VARCHAR(250),");
	sbf.append("PRICE NUMERIC(10,2),"); 
	sbf.append("ORDER_URL VARCHAR(250),");
	sbf.append("DESCRIPTION VARCHAR(500),");
	sbf.append("FEATURES VARCHAR(500),");
	sbf.append("IMAGE VARCHAR(200),");
	sbf.append("REBATE_URL VARCHAR(250),");
	sbf.append("COUPON_CODE VARCHAR(20),");
	sbf.append("COUPON_EXP_DATE VARCHAR(20),");
	sbf.append("COMPANY VARCHAR(250),");
 	sbf.append("COMPANY_URL VARCHAR(250),");
 	sbf.append("RATING_PRODUCT NUMERIC(2,2),");
	sbf.append("RATING_PRICE NUMERIC(2,2),");
	sbf.append("RATING_SERVICE NUMERIC(2,2),");
	sbf.append("TOTAL_RATERS INT(10),");
	sbf.append("COUNTER INT(10));");  
           
	return sbf;
    }
}
 

